package com.platform.hjt.sys.model;

import java.sql.Timestamp;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.hibernate.annotations.GenericGenerator;

import com.platform.hjt.sys.model.json.SysModelSerialize;

/**
 * SysModel entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sys_model")
public class SysModel implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 7055507972138618077L;
	private String sysModelId;
	private SysModel sysModel;
	private String modelName;
	private String modelType;
	private String modelUrl;
	private String modelIcon;
	private Timestamp createTime;
	private Boolean isDel;
	private Integer sortIndex;

	private Boolean showProgess;
	
	// Constructors

	/** default constructor */
	public SysModel() {
	}

	/** minimal constructor */
	public SysModel(String sysModelId) {
		this.sysModelId = sysModelId;
	}

	/** full constructor */
	public SysModel(String sysModelId, SysModel sysModel, String modelName,
			String modelType, String modelUrl, String modelIcon,
			Timestamp createTime, Boolean isDel, Integer sortIndex,
			Set<SysCompanyModel> sysCompanyModels,
			Set<SysUserModel> sysUserModels, Set<SysModel> sysModels) {
		this.sysModelId = sysModelId;
		this.sysModel = sysModel;
		this.modelName = modelName;
		this.modelType = modelType;
		this.modelUrl = modelUrl;
		this.modelIcon = modelIcon;
		this.createTime = createTime;
		this.isDel = isDel;
		this.sortIndex = sortIndex;
	}

	// Property accessors
	@Id
	@GenericGenerator(name="systemUUID",strategy="uuid")
	@GeneratedValue(generator="systemUUID")
	@Column(name = "sys_model_id", unique = true, nullable = false, length = 32)
	public String getSysModelId() {
		return this.sysModelId;
	}

	public void setSysModelId(String sysModelId) {
		this.sysModelId = sysModelId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "super_model_id")
	@JsonSerialize(using = SysModelSerialize.class)
	public SysModel getSysModel() {
		return this.sysModel;
	}

	public void setSysModel(SysModel sysModel) {
		this.sysModel = sysModel;
	}

	@Column(name = "model_name", length = 100)
	public String getModelName() {
		return this.modelName;
	}

	public void setModelName(String modelName) {
		this.modelName = modelName;
	}

	@Column(name = "model_type", length = 1)
	public String getModelType() {
		return this.modelType;
	}

	public void setModelType(String modelType) {
		this.modelType = modelType;
	}

	@Column(name = "model_url", length = 200)
	public String getModelUrl() {
		return this.modelUrl;
	}

	public void setModelUrl(String modelUrl) {
		this.modelUrl = modelUrl;
	}

	@Column(name = "model_icon", length = 200)
	public String getModelIcon() {
		return this.modelIcon;
	}

	public void setModelIcon(String modelIcon) {
		this.modelIcon = modelIcon;
	}

	@Column(name = "create_time", length = 19)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@Column(name = "is_del")
	public Boolean getIsDel() {
		return this.isDel;
	}

	public void setIsDel(Boolean isDel) {
		this.isDel = isDel;
	}

	@Column(name = "sort_index")
	public Integer getSortIndex() {
		return this.sortIndex;
	}

	public void setSortIndex(Integer sortIndex) {
		this.sortIndex = sortIndex;
	}
	
	@Column(name = "show_progess")
	public Boolean getShowProgess() {
		return showProgess;
	}

	public void setShowProgess(Boolean showProgess) {
		this.showProgess = showProgess;
	}

}